Skip to main content

Resize disk online in Linux

· One min read

Resize disk without power off in Linux (ESXi)

Extend disk size in ESXi

Resize can be done in GUI, or CLI

Ref: Increasing the size of a virtual disk (1004047)

# vmkfstools -X <new size> <disk.vmdk>

vmkfstools -X 1T disk.vmdk

Rescan disks

Tell Linux to rescan disks

# echo 1 > /sys/class/block/<dev>/device/rescan

echo 1 > /sys/class/block/sda/device/rescan

Show disk / partition info

cfdisk

or

# parted /dev/<disk> p

parted /dev/sda p

Resize the partition

# parted <disk> resizepart <partition> <new size>

parted /dev/sda resizepart 1 100%

Show LVM PV info

pvs

Resize PV

See LVM PV

Resize LV

See LVM PV